package com.escom.utils;

import android.content.SharedPreferences;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.escom.activity.AirFlowFragment;
import com.escom.activity.ElectroFragment;
import com.escom.activity.OximetroFragment;
import com.escom.activity.PositionFragment;
import com.escom.activity.TemperaturaFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Carlos on 19/04/2014.
 */
public class TabsAdapterEstudio extends FragmentPagerAdapter {

    private List<Fragment> tabFragment;

    public TabsAdapterEstudio(FragmentManager fm, SharedPreferences sharedpreferences) {
        super(fm);
        tabFragment = new ArrayList<Fragment>();

        ElectroFragment electroFragment = new ElectroFragment();
        AirFlowFragment airFlowFragment = new AirFlowFragment();
        OximetroFragment oximetroFragment = new OximetroFragment();
        PositionFragment positionFragment = new PositionFragment();
        TemperaturaFragment temperaturaFragment = new TemperaturaFragment();
        tabFragment.add(electroFragment);
        tabFragment.add(airFlowFragment);
        tabFragment.add(oximetroFragment);
        tabFragment.add(positionFragment);
        tabFragment.add(temperaturaFragment);
    }

    @Override
    public Fragment getItem(int index) {
        return tabFragment.get(index);
    }

    @Override
    public int getCount() {
        // get item count - equal to number of tabs
        return tabFragment.size();
    }


}